var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/security/3rdparty/detach', function(req, res, next) {
	const debug = req.query.debug
    const areaJson =  
   	{
	    code: 0,
	    data: {
	        summary: {
	            level: 3,
	            mobile: "135****1722",
	            thirdparty_attached: 0,
	            questions: [
	                {
	                    id: 1,
	                    question: "您父亲的名字是？"
	                },
	                {
	                    id: 4,
	                    question: "您小学班主任名字是？"
	                },
	                {
	                    id: 2,
	                    question: "您最熟的童年好友是？"
	                }
	            ]
	        },
	        user: {
	            nickname: "zhangyuge",
	            uid: 2198997,
	            username: "tt10001888"
	        }
	    },
	    msg: "OK"
	}
   	res.setHeader('Access-Control-Allow-Origin', '*');
   	debug == '1' && res.json(areaJson)
  	res.jsonp(areaJson);  
});

router.post('/security/phone/unbind', function(req, res, next) {
	const debug = req.query.debug
    const areaJson =  
   	{
	    code: 0,
	    data: {
	        summary: {
	            level: 3,
	            mobile: "135****1722",
	            thirdparty_attached: 0,
	            questions: [
	                {
	                    id: 1,
	                    question: "您父亲的名字是？"
	                },
	                {
	                    id: 4,
	                    question: "您小学班主任名字是？"
	                },
	                {
	                    id: 2,
	                    question: "您最熟的童年好友是？"
	                }
	            ]
	        },
	        user: {
	            nickname: "zhangyuge",
	            uid: 2198997,
	            username: "tt10001888"
	        }
	    },
	    msg: "OK"
	}
   	res.setHeader('Access-Control-Allow-Origin', '*');
   	debug == '1' && res.json(areaJson)
  	res.jsonp(areaJson);  
});


module.exports = router;
